//
//  DECXDeliveryOrder.m
//  DECXInStore
//
//  Created by 李坤 on 2018/9/10.
//  Copyright © 2018年 程强. All rights reserved.
//

#import "DECXDeliveryOrder.h"

@implementation DECXDeliveryOrder
- (instancetype)initWithResponse:(NSDictionary *)dic
{
    if (self = [super init]) {
        _xid = ValidString(dic[@"id"]);
        _get_id = ValidString(dic[@"get_id"]);/**<提货码*/
        _getlist_id = ValidString(dic[@"getlist_id"]);/**<提单号*/
        _get_weight = ValidString(dic[@"get_weight"]);/**<申请提货数量*/
        _get_weight_remain = ValidString(dic[@"get_weight_remain"]);/**<剩余提货数量*/
        _get_atime = [ToolKit timeStampTurnDate:ValidString(dic[@"get_atime"])];/**<申请提货时间*/
        _isget = ValidString(dic[@"isget"]);/**<0:不允许 1:允许  2:已提完*/
        _goods_type = ValidString(dic[@"goods_type"]);
        _getlist_pic_small = ValidString(dic[@"getlist_pic_small"]);
        _category_name = ValidString(dic[@"category_name"]);
        
        NSArray *arr = dic[@"driver"];
        NSMutableArray *temp = @[].mutableCopy;
        for (NSDictionary *dver in arr) {
            DECXDriverObj *driverObj = [[DECXDriverObj alloc]initWithOrderResponse:dver];
            [temp addObject:driverObj];
        }
        _driver = temp;
        _order = [NSString stringWithFormat:@"%@",dic[@"order"]];
        _depot_price = ValidString(dic[@"depot_price"]);
        _order_state = ValidString(dic[@"order_state"]);
        _order_id = ValidString(dic[@"order_id"]);
    }
    return self;
}
@end
